<?php if (!defined('THINK_PATH')) exit();?>﻿<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="/thinkphp2/Public/lib/html5shiv.js"></script>
<script type="text/javascript" src="/thinkphp2/Public/lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="/thinkphp2/Public/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="/thinkphp2/Public/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="/thinkphp2/Public/lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="/thinkphp2/Public/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="/thinkphp2/Public/static/h-ui.admin/css/style.css" />
<!--[if IE 6]>
<script type="text/javascript" src="/thinkphp2/Public/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>问题分类管理</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 问题管理 <span class="c-gray en">&gt;</span> 问题分类管理 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
	<div class="cl pd-5 bg-1 bk-gray"> <span class="l"> <a href="javascript:;" onclick="deleteBatch();"  class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a> <a class="btn btn-primary radius" href="javascript:;" onclick="admin_role_add('添加分类','issuetype-add.html','600','300')"><i class="Hui-iconfont">&#xe600;</i> 添加分类</a> </span> <span class="r">共有数据：<strong>54</strong> 条</span> </div>
	<table class="table table-border table-bordered table-hover table-bg">
		<thead>
			<tr>
				<th scope="col" colspan="6">问题分类管理</th>
			</tr>
			<tr class="text-c">
				<th width="10%"><input type="checkbox" value="" name="" id="checkMg"></th>
				<th width="10%">ID</th>
				<th width="30%">分类名称</th>
				<th width="30%">分类描述</th>
				<th width="">操作</th>
			</tr>
		</thead>
		<tbody>
		<?php if(is_array($issuetypes)): foreach($issuetypes as $key=>$vo): ?><tr class="text-c" id="<?php echo ($vo["issuetype_id"]); ?>">
				<td><input type="checkbox" value="<?php echo ($vo["issuetype_id"]); ?>" name="sec_id_check"></td>
				<td><?php echo ($vo["issuetype_id"]); ?></td>
				<td><?php echo ($vo["issuetype_name"]); ?></td>
				<td><?php echo ($vo["issuetype_note"]); ?></td>
				<td class="f-14"><a title="编辑" href="javascript:;"
									onclick="admin_role_edit('分类编辑','issuetype_edit.html?id=<?php echo ($vo["issuetype_id"]); ?>','<?php echo ($vo["issuetype_id"]); ?>',600,300)"
									style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i></a>
					<?php if(C("PLATFORM_DELETION")!= true): ?><a title="删除"
						   href="javascript:;"
						   onclick='admin_role_del(this,"<?php echo U('Index/Duty/issuetype_del',array('id'=>$vo['issuetype_id']));?>")'
						class="ml-5"
						style="text-decoration:none"><i
							class="Hui-iconfont">&#xe6e2;</i></a><?php endif; ?>
					</td>
			</tr><?php endforeach; endif; ?>
		</tbody>
	</table>
</div>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="/thinkphp2/Public/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="/thinkphp2/Public/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="/thinkphp2/Public/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="/thinkphp2/Public/static/h-ui.admin/js/H-ui.admin.js"></script>
<!--/_footer 作为公共模版分离出去-->
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="/thinkphp2/Public/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript">
	function deleteBatch() {
		var ids = [];
		$.each($("input[type='checkbox']"), function (key, value) {
			if ($(value).is(":checked")) {
				var v_id = $(value).val();
				if (v_id) {
					ids.push($(value).val());
				}
			}
		});
		console.log(ids);
		var json = {};
		json['ids'] = ids;
		$.ajax({
			url:"<?php echo U('/Index/Duty/issuetype_batch_del');?>",
			type: 'POST',
			dataType: "JSON",
			contentType: 'application/json',
			data: JSON.stringify(json),
			success: function (data) {
				if(data.status == 0){
					$.each(data['data'], function(key,value){
						$("#" + value).remove();
					});
					$("#checkMg").prop("checked",false);
				}
				layer.msg('已删除!', {icon: 1, time: 1000});

			},
			error: function (data) {
				console.log(data.msg);
			},
		});
	}


	/*管理员-角色-添加*/
	function admin_role_add(title, url, w, h) {
		layer_show(title, url, w, h);
	}
	/*管理员-角色-编辑*/
	function admin_role_edit(title, url, id, w, h) {
		layer_show(title, url, w, h);
	}
	/*管理员-角色-删除*/
	function admin_role_del(obj, url) {
		layer.confirm('问题分类删除须谨慎，确认要删除吗？', function () {
			$.ajax({
				type: 'GET',
				dataType: "JSON",
				url: url,
				contentType: 'application/json',
				success: function () {
					$(obj).parents("tr").remove();
					layer.msg('已删除!', {icon: 1, time: 1000});
				},
				error: function (data) {
					console.log(data.msg);
				},
			});
		});
	}
</script>
</body>
</html>